﻿namespace Moe.ECamel.Common.Entities
{
	using System;

	partial class Item
	{
		public ECamelError Validate()
		{
			// Verify mandatory fields:
			string emptyFields = null;
			if (String.IsNullOrEmpty(_CatalogNumber))
				emptyFields += "מספר קטלוגי" + Environment.NewLine;
			if (String.IsNullOrEmpty(_Title))
				emptyFields += "כותרת" + Environment.NewLine;
			if (emptyFields != null)
				return new ECamelError(MessageIds.ItemInvalidMissingFields, emptyFields);

			return null;
		}
	}
}